package com.atguigu.controller;

import cn.hutool.core.util.IdUtil;
import com.atguigu.annotation.CustomerLogAnnotation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@RestController
@Slf4j
public class CustomerController {

    @GetMapping("/customer/m1")
    public String m1() {
        String result = "";
        //开始时间
        long startTime = System.currentTimeMillis();
        System.out.println("方法执行之前");
        result = IdUtil.simpleUUID();
        System.out.println("方法执行" + result);
        System.out.println("方法执行之后");
        //结束时间
        long endTime = System.currentTimeMillis();
        System.out.println("耗时时间costTime =" + (endTime - startTime) + "毫秒");


        return result;
    }

    @CustomerLogAnnotation(value = "qqq", enable = true)
    @GetMapping("/customer/m2")
    public String m2() {
        String result = "";

        result = IdUtil.simpleUUID();
        System.out.println("方法执行" + result);


        return result;
    }
    @CustomerLogAnnotation(value = "qqq", enable = false)
    @GetMapping("/customer/m3")
    public String m3() {
        String result = "";

        result = IdUtil.simpleUUID();
        System.out.println("方法执行" + result);

        
        return result;
    }
}
